package cn.itcast.staticandfinal;

import java.time.LocalDate;

/**
 * @title: Permission
 * @Author Zhou
 * @Date: 2022/1/21 10:58
 * @Version 1.0
 */
public class Permission {
    public static void main(String[] args) {
        Ta t = new Ta(23, new StringBuilder("sdf"));
        System.out.println("t = " + t);
        t.giveF();
        System.out.println("t = " + t);
        t.builder.append("wdnm");
        System.out.println("t = " + t);
    }
}

class Ta {
    public final int age;
    public final StringBuilder builder;

    public Ta(int age, StringBuilder builder) {
        this.age = age;
        this.builder = builder;
    }

    @Override
    public String toString() {
        return "Ta{" +
                "age=" + age +
                ", builder=" + builder +
                '}';
    }

    public void giveF() {
        builder.append(LocalDate.now() + ":GOld star!");
    }
}
